From: Brion Vibber Date: Mon, 27 Aug 2007 21:32:47 +0000 (+0000) Subject: * (bug 11072) Fix regression in API image history query X-Git-Tag: 1.31.0-rc.0~51629 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=341eaa78099021784b2a21fbfca43943e85f8f23;p=lhc%2Fweb%2Fwiklou.git * (bug 11072) Fix regression in API image history query LocalFile::nextHistoryLine() now returns original column names for oldimage rows instead of aliasing them to image column names. That whole interface should fucking die, it's hideous. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9cfc8384e9..f3bfd9e097 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -417,6 +417,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Preventing the TOC from appearing in Special:Statistics * (bug 11082) Fix check for fully-specced table names in Database::tableName * (bug 11067) Fix regression in upload conflict thumbnail display +* (bug 11072) Fix regression in API image history query == API changes since 1.10 == diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 56c1c1278d..7566f722c5 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -67,24 +67,26 @@ class ApiQueryImageInfo extends ApiQueryBase { $isCur = true; while($line = $img->nextHistoryLine()) { // assignment + $row = get_object_vars( $line ); $vals = array(); + $prefix = $isCur ? 'img' : 'oi'; if ($fld_timestamp) - $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $line->img_timestamp); + $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row["${prefix}_timestamp"]); if ($fld_user) { - $vals['user'] = $line->img_user_text; - if(!$line->img_user) + $vals['user'] = $row["${prefix}_user_text"]; + if(!$row["${prefix}_user"]) $vals['anon'] = ''; } if ($fld_size) { - $vals['size'] = intval($line->img_size); - $vals['width'] = intval($line->img_width); - $vals['height'] = intval($line->img_height); + $vals['size'] = intval($row["{$prefix}_size"]); + $vals['width'] = intval($row["{$prefix}_width"]); + $vals['height'] = intval($row["{$prefix}_height"]); } if ($fld_url) - $vals['url'] = $isCur ? $img->getURL() : $img->getArchiveUrl($line->oi_archive_name); + $vals['url'] = $isCur ? $img->getURL() : $img->getArchiveUrl($row["oi_archive_name"]); if ($fld_comment) - $vals['comment'] = $line->img_description; + $vals['comment'] = $row["{$prefix}_description"]; $data[] = $vals;